package com.learn.designPatterns.behavioral.iterator;

/**
 * @classname:
 * @Description:
 * @author: yfpu
 * @Date: 2018-09-18 15:30
 */
public class ConcreteAggregate implements Aggregate{

    private  Integer[] items;

    public ConcreteAggregate() {
        items = new Integer[10];
        for (int i = 0; i < items.length; i++) {
            items[i] = i;
        }
    }

    @Override
    public Iterator createIterator() {
        return new ConcreteIterator<Integer>(items);
    }
}
